#include "Zigbee3QuitBackCmd.h"

Zigbee3QuitBackCmd::Zigbee3QuitBackCmd(QObject *parent) :
    BaseCmd(parent)
{
    this->m_protocolType = ProtocolType::ZigbeeNewControlProtocol;
    this->m_functionCode = FunctionCode;
}

Package Zigbee3QuitBackCmd::toPackage()
{
    Package package;
    package.setFunction(FunctionCode);
    return package;
}

void Zigbee3QuitBackCmd::unPackage(Package package)
{
    qDebug()<<"unpackage zigbee newcmd";
    qDebug()<<package.body().toHex().data();
    QByteArray body = package.body();
    m_nwk=body.mid(0,2);
    m_mac=body.mid(2,8);
    qDebug()<<"m_nwk="<<m_nwk;
    qDebug()<<"m_mac="<<m_mac;
}
QByteArray Zigbee3QuitBackCmd::Mac()
{
    return m_mac;
}
QByteArray Zigbee3QuitBackCmd::Nwk()
{
    return m_nwk;
}
